package com.jy.horny.api

import android.content.Context


/**
 * @ClassName: RootDomainManager
 * @Description: 域名管理类
 * @Author: You
 */
class RootDomainManager {
    private var map: MutableMap<String, String> = mutableMapOf()

    companion object {
        const val URL_UP = "url_up"

        @Volatile
        private var instance: RootDomainManager? = null

        fun getInstance(context: Context): RootDomainManager {
            return synchronized(this) {
                instance ?: RootDomainManager().also {
                    it.getDomainMap(context)
                    instance = it
                }
            }
        }
    }

    /**
     * 获取域名集合
     */
    fun getDomainMap(context: Context): MutableMap<String, String> {
        map.clear()
        map[URL_UP] = ""
        return map
    }

}